package com.sun.controller;

import com.alibaba.fastjson2.JSONObject;
import com.sun.config.AppConfig;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ApolloController {

   private final AppConfig appConfig;

    // http://localhost:8088/apolloConfig
    @GetMapping(value = "/apolloConfig")
    public String apolloConfig() {
        return JSONObject.toJSONString(appConfig);
    }

}

